<!DOCTYPE html>
<html class="ui-page-login">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>修改密码</title>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<link href="css/reg_style.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/common.css"/>
	</head>
	<style type="text/css">
		header em{
			color: #4198FF;
		}
	</style>
	<body>
		<header class="mui-bar mui-bar-nav head1">
			<em class="mui-action-back"><img class="img1" src="img/fanhui.png" alt="" /></em>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded content-box">
				<h3 class="title-ver">请输入密码</h3>
				<form id='login-form' class="mui-input-group">
					<div class="mui-input-row char4">
						<label>旧密码</label>
						<input maxlength="16" id='passwordold' type="password" class="mui-input-clear mui-input" placeholder="请输入您的旧密码">
					</div>
					<div class="mui-input-row char4">
						<label>新密码</label>
						<input onkeyup="judge_psw();" maxlength="16" id='password' type="password" class="mui-input-clear mui-input" placeholder="请输入您的新密码">
					</div>
					<div class="mui-input-row char4">
						<label>再次输入</label>
						<input onkeyup="judge_psw();" maxlength="16" id='passwordtoo' type="password" class="mui-input-clear mui-input" placeholder="请再次输入您的新密码">
					</div>
				</form>
				<div class="link-area forgetPassword red">
					<a id='forgetPassword'>&nbsp;</a>
				</div>
				
			</div>
			<button onclick="mine_modify_password();" disabled="disabled" id='btn_login' class="mui-btn mui-btn-block mui-btn-primary jianbiananniu">确定</button>
			<div class="mui-content-padded oauth-area">

			</div>
		</div>

		<!--/********************日期控件**************************/-->
		<!--<link rel="stylesheet" type="text/css" href="css/hgs-date.css" />
		<script src="js/hgs-date.js"></script>-->
		<!--/********************日期控件**************************/-->
		<input id="index-shop-lists-id" type="hidden">
		<input id="index-shop-lists" type="hidden">
		<input id='index-end-date' type="hidden" />
		<input id='index-start-date' type="hidden" />

		<!--/***************************************************/-->

		<script src="js/mui.min.js"></script>
		<script src="js/mui.enterfocus.js"></script>
		<script src="js/app.js"></script>
		<script src="js/jquery.js"></script>
		<!--<script type="text/javascript" src="js/jsencrypt.min.js"></script>
		<script src="js/md5.js"></script>-->
		<script src="js/crypto-js.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript" src="js/fuction.js"></script>
		<script>
			//判断两次密码，是否正确
			function judge_psw() {
				var password = mui('#password')[0].value;
				var passwordtoo = mui('#passwordtoo')[0].value;
				if(password.length < 6 || passwordtoo.length < 6) {
					document.getElementById("btn_login").disabled = true;
					btn_login_se('jianbian1_qianse',"#btn_login");
					return;
				}

				if(passwordtoo == password) {
					document.getElementById("btn_login").disabled = false;
					btn_login_se('jianbian3_shengse',"#btn_login");
					mui("#forgetPassword")[0].innerHTML = '&nbsp;';
				} else {
					document.getElementById("btn_login").disabled = true;
					btn_login_se('jianbian1_qianse',"#btn_login");
					if(passwordtoo == '' || password == '') {
						mui("#forgetPassword")[0].innerHTML = '&nbsp;';
					} else {
						mui("#forgetPassword")[0].innerHTML = '两次输入的密码不一致，请重新输入';
					}

				}

			}

			mui.ready(function() {
				//获取当前的客户数据
				xminereadyload();
			});



			
			
			//修改个人密码
			function mine_modify_password() {
				var xbx = {}; //登录后的参数对象AES加密
				xbx.old_password = mui("#passwordold")[0].value; //以前密码
				xbx.new_password = mui("#password")[0].value; //新密码

				if(!testpass(xbx.new_password)){
					return;
				};

				xbx.old_password = md5(xbx.old_password);
				xbx.old_password = xbx.old_password.toLowerCase();

				xbx.new_password = md5(xbx.new_password);
				xbx.new_password = xbx.new_password.toLowerCase();
				
				var phoneVeg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
					if(phoneVeg.test($("#password").val())) {
					official_login_after(url_host + 'mine/modify/password', xbx, 'mine_modify_password');
					}
					else{
						alert('请输入8-16位包含字母的密码')
					}
//				official_login_after(url_host + 'mine/modify/password', xbx, 'mine_modify_password');

			};
		</script>
	</body>

</html>